/**
 * 
 */
package com.twarder.struts.action.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.twarder.struts.action.BaseAction;
import com.twarder.struts.exception.ApplicationException;
import com.twarder.struts.exception.SystemException;
import com.twarder.struts.form.IndexForm;

/**
 * @author Administrator
 *
 */
public class AdminIndexAction extends BaseAction {
	
    public static final String INITIAL = "initial";
    
    public static final String CLICK = "click";
    
    public static final String USER = "user";

    public static final String HEAD = "head";

    public static final String SIDE = "side";

    public static final String MAIN = "main";
    
    public static final String FOOT = "foot";

    public static final String FIRSTPAGE = "firstpage";
    
    public static final String SELFINFO = "selfinfo";
    
    public static final String EBOOKCENTER = "ebookcenter";
    
    public static final String BLOG = "blog";
    

	@Override
	protected ActionForward process(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws ApplicationException, SystemException {
        IndexForm formbean = (IndexForm) form;
        String actionType = request.getParameter("actionType");

        formbean.setActionType(null);
        if(HEAD.equals(actionType))
        {
            return mapping.findForward(HEAD);
        }
        else if(SIDE.equals(actionType))
        {
            return mapping.findForward(SIDE);
        }
        else if(MAIN.equals(actionType))
        {
            return mapping.findForward(MAIN);
        }
        else if(FOOT.equals(actionType))
        {
            return mapping.findForward(FOOT);
        }
        else if(FIRSTPAGE.equals(actionType))
        {
            return mapping.findForward(FIRSTPAGE);
        }
        else if(SELFINFO.equals(actionType))
        {
            return mapping.findForward(SELFINFO);
        }
        else if(EBOOKCENTER.equals(actionType))
        {
            return mapping.findForward(EBOOKCENTER);
        }
        else if(BLOG.equals(actionType))
        {
            return mapping.findForward(BLOG);
        }
        else if(USER.equals(actionType))
        {
            return mapping.findForward(USER);
        }
        else
        {
            return mapping.getInputForward();
        }
    }

}
